<template>
	<view class="">
		<get-coupon onGetCouponSuccess="onGetCouponSuccess" onGetCouponFail="onGetCouponFail"
			onUseImmediately="onUseImmediately" onClose="onClose" :params="params" :zIndex="4">
			<!-- 内部为自定义代码，「按钮」代码写在这里 -->
			<view class="text-button">领券</view>
		</get-coupon>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				params: [{
					activityId: '2025071000826004419639138301',
					outBizNo: 'TEST202507090002', // 导码模式商家券
				}],
				dialogBtnType: 1,
				dialogBtnStyle: {
					color: "#000",
					borderColor: "#ffecee",
					backgroundColor: "#ffecee"
				}
			}
		},
		methods: {
			onGetCouponSuccess(resultList, {
				extraData
			}) {
				console.log('触发了 onGetCouponSuccess 事件')
				console.log('成功返回结果: ', resultList)
			},
			onGetCouponFail(result, {
				extraData
			}) {
				console.log('触发了 onGetCouponFail 事件')
				console.log('失败返回结果: ', result)
			},
			onUseImmediately(event, {
				extraData
			}) {
				console.log('触发了 onUseImmediately 事件')
			},
			onClose(event, {
				extraData
			}) {
				console.log('触发了 onClose 事件')
			},

		},
		onLoad() {
			console.log('MP-ALIPAY')
			this.$scope.onClose = this.onClose.bind(this)
			this.$scope.onGetCouponSuccess = this.onGetCouponSuccess.bind(this)
			this.$scope.onGetCouponFail = this.onGetCouponFail.bind(this)
			// this.onGetCouponSuccess()
			console.log('MP-ALIPAY55')
		}
	}
</script>

<style>
</style>